/**
 * @file    flash_blob.h
 * @brief   Flash algorithm for the rza1h
 *
 * DAPLink Interface Firmware
 * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef TARGET_FLASH_H
#define TARGET_FLASH_H

#include "target_struct.h"
#include "swd_host.h"
#include "stdint.h"

#define RAM_START    0x20020000

static const uint32_t RZA1H_FLM[] = {
    0xE1200070, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2,
    0xe92d41f0, 0xe1a04000, 0xe1a06001, 0xe1a07002, 0xe59f00e0, 0xe0800009, 0xe5804000, 0xeb00079c,
    0xe1a05000, 0xe3550000, 0x0a000001, 0xe3a00001, 0xe8bd81f0, 0xe3a00000, 0xeafffffc, 0xe92d4010,
    0xe1a04000, 0xeb0007a4, 0xe3a00000, 0xe8bd8010, 0xe92d4010, 0xeb0007ae, 0xe1a04000, 0xe3540000,
    0x0a000001, 0xe1a00004, 0xe8bd8010, 0xe3540000, 0x0a000001, 0xe3a00001, 0xeafffffa, 0xe3a00000,
    0xeafffff8, 0xe92d4070, 0xe1a04000, 0xe1a00004, 0xeb000799, 0xe1a05000, 0xe3550000, 0x0a000001,
    0xe3a00001, 0xe8bd8070, 0xe3a00000, 0xeafffffc, 0xe92d41f0, 0xe1a04000, 0xe1a05001, 0xe1a06002,
    0xe59f1030, 0xe0811009, 0xe5911000, 0xe0440001, 0xe1a02006, 0xe1a01005, 0xeb000791, 0xe1a07000,
    0xe3570000, 0x0a000001, 0xe3a00001, 0xe8bd81f0, 0xe3a00000, 0xeafffffc, 0x00000004, 0xe3a01001,
    0xe59f202c, 0xe5821000, 0xe1c21001, 0xe5910000, 0xe3011035, 0xe59f201c, 0xe1c211b0, 0xe3a01003,
    0xe1c211b4, 0xe3a0100f, 0xe2822b01, 0xe1c210b8, 0xe12fff1e, 0x3fffff80, 0xfcfe0000, 0xe59f08d8,
    0xe5900000, 0xe2000102, 0xe3500000, 0x0a00000b, 0xe59f08c4, 0xe5900048, 0xe2000002, 0xe3500000,
    0x0a000001, 0xe3e00000, 0xe12fff1e, 0xe59f08a8, 0xe5900000, 0xe3c00102, 0xe59f189c, 0xe5810000,
    0xe3a00000, 0xeafffff7, 0xe59f088c, 0xe5900000, 0xe2000102, 0xe3500102, 0x0a00000b, 0xe59f0878,
    0xe5900048, 0xe2000002, 0xe3500000, 0x0a000001, 0xe3e00000, 0xe12fff1e, 0xe59f085c, 0xe5900000,
    0xe3800102, 0xe59f1850, 0xe5810000, 0xe3a00000, 0xeafffff7, 0xe1a01000, 0xe59f083c, 0xe5900048,
    0xe2000002, 0xe3500000, 0x0a000001, 0xe3a00001, 0xe12fff1e, 0xe59f0820, 0xe5900000, 0xe2000003,
    0xe1500001, 0x0a00001f, 0xe3510001, 0x1a000013, 0xe59f0808, 0xe1d000bc, 0xe38000fc, 0xe59f27fc,
    0xe1c202b4, 0xe2820c01, 0xe1d000bc, 0xe3c000fc, 0xe2822c01, 0xe1c202b4, 0xe2820b01, 0xe1d000bc,
    0xe3c000fc, 0xe2822b01, 0xe1c202b4, 0xe2420c06, 0xe1d000bc, 0xe38000fc, 0xe2422c06, 0xe1c202b4,
    0xe59f07b4, 0xe5900000, 0xe3c00003, 0xe1800001, 0xe59f27a4, 0xe5820000, 0xe1a00002, 0xe5900000,
    0xe3800c02, 0xe582000c, 0xe3a00000, 0xeaffffd7, 0xe59f0784, 0xe5900000, 0xe2000003, 0xe12fff1e,
    0xe52de004, 0xe1a03000, 0xe59f0774, 0xe5d00000, 0xe3c00008, 0xe59f1768, 0xe5c10000, 0xe59f0764,
    0xe1d002b4, 0xe38000fc, 0xe59f1758, 0xe1c102b4, 0xe2410c3f, 0xe1d002b4, 0xe3c000fc, 0xe2411c3f,
    0xe1c102b4, 0xe2810c02, 0xe1d002b4, 0xe38000fc, 0xe2811c02, 0xe1c102b4, 0xe2810c01, 0xe1d002b4,
    0xe3c000fc, 0xe2811c01, 0xe1c102b4, 0xe2810b01, 0xe1d002b4, 0xe3c000fc, 0xe2811b01, 0xe1c102b4,
    0xe2410c06, 0xe1d002b4, 0xe38000fc, 0xe2411c06, 0xe1c102b4, 0xe3530001, 0x1a000013, 0xe2810c01,
    0xe1d000bc, 0xe3800b0f, 0xe2811c01, 0xe1c100bc, 0xe2810c01, 0xe1d000bc, 0xe3c00b0f, 0xe2811c01,
    0xe1c100bc, 0xe2810b01, 0xe1d000bc, 0xe3c00b0f, 0xe2811b01, 0xe1c100bc, 0xe2410c06, 0xe1d000bc,
    0xe3800b0f, 0xe2411c06, 0xe1c100bc, 0xe59f0688, 0xe5900048, 0xe2000002, 0xe3500000, 0x0a000001,
    0xe3a00001, 0xe49df004, 0xe59f066c, 0xe5900000, 0xe38008ff, 0xe3800cf3, 0xe59f165c, 0xe5810000,
    0xe1a00001, 0xe5900000, 0xe3c00078, 0xe3800020, 0xe5810000, 0xe1a00003, 0xebffff7d, 0xe59f0638,
    0xe5900004, 0xe59f1640, 0xe0000001, 0xe59f1628, 0xe5810004, 0xe1a00001, 0xe5900008, 0xe30f1f03,
    0xe1c00001, 0xe3800c02, 0xe59f160c, 0xe5810008, 0xe3a00000, 0xeaffffe2, 0xe1a01000, 0xe59f05f8,
    0xe5900048, 0xe2000002, 0xe3500000, 0x0a000001, 0xe3a00001, 0xe12fff1e, 0xe59f05dc, 0xe5900000,
    0xe3c00102, 0xe59f25d0, 0xe5820000, 0xe1a00002, 0xe590000c, 0xe59f25d4, 0xe0000002, 0xe3800801,
    0xe3800c01, 0xe3800001, 0xe59f25ac, 0xe582000c, 0xe1a00002, 0xe5900048, 0xe2000001, 0xe3500000,
    0x1a000001, 0xe3a00001, 0xeaffffe9, 0xe59f0588, 0xe5900010, 0xe3c008ff, 0xe1800801, 0xe59f2578,
    0xe5820010, 0xe1a00002, 0xe590001c, 0xe3c00103, 0xe3c00901, 0xe3800901, 0xe582001c, 0xe1a00002,
    0xe5900010, 0xe3c000ff, 0xe1800001, 0xe5820010, 0xe1a00002, 0xe590001c, 0xe3c00203, 0xe3c00a01,
    0xe582001c, 0xe35100bb, 0x1a000007, 0xe1a00002, 0xe590001c, 0xe3c00403, 0xe3c00c0f, 0xe3800401,
    0xe3800c07, 0xe582001c, 0xea000011, 0xe35100eb, 0x1a000008, 0xe59f0500, 0xe590001c, 0xe3c00403,
    0xe3c00c0f, 0xe3800402, 0xe3800c07, 0xe59f24e8, 0xe582001c, 0xea000006, 0xe59f04dc, 0xe590001c,
    0xe3c00403, 0xe3c00c0f, 0xe3800c07, 0xe59f24c8, 0xe582001c, 0xe35100bb, 0x1a00000c, 0xe59f04b8,
    0xe5900018, 0xe3a00000, 0xe59f24ac, 0xe5820018, 0xe1c20000, 0xe590001c, 0xe3c00603, 0xe3c000f0,
    0xe3800601, 0xe3800080, 0xe582001c, 0xea000019, 0xe35100eb, 0x1a00000c, 0xe59f047c, 0xe5900018,
    0xe3a00000, 0xe59f2470, 0xe5820018, 0xe1c20000, 0xe590001c, 0xe3c00603, 0xe3c000f0, 0xe3800602,
    0xe38000e0, 0xe582001c, 0xea00000a, 0xe59f0448, 0xe5900018, 0xe3a00000, 0xe59f243c, 0xe5820018,
    0xe1c20000, 0xe590001c, 0xe3c00603, 0xe3c000f0, 0xe3800080, 0xe582001c, 0xe351006b, 0x1a000006,
    0xe59f0414, 0xe590001c, 0xe3c00803, 0xe3800802, 0xe59f2404, 0xe582001c, 0xea000024, 0xe351003b,
    0x1a000006, 0xe59f03f0, 0xe590001c, 0xe3c00803, 0xe3800801, 0xe59f23e0, 0xe582001c, 0xea00001b,
    0xe351000b, 0x1a000005, 0xe59f03cc, 0xe590001c, 0xe3c00803, 0xe59f23c0, 0xe582001c, 0xea000013,
    0xe35100bb, 0x1a000006, 0xe59f03ac, 0xe590001c, 0xe3c00803, 0xe3800801, 0xe59f239c, 0xe582001c,
    0xea00000a, 0xe35100eb, 0x1a000006, 0xe59f0388, 0xe590001c, 0xe3c00803, 0xe3800802, 0xe59f2378,
    0xe582001c, 0xea000001, 0xe3a00001, 0xeaffff60, 0xe3a00000, 0xeaffff5e, 0xe92d4008, 0xe1a01000,
    0xe59f0354, 0xe5900000, 0xe2000102, 0xe3500102, 0x0a00000b, 0xe59f0340, 0xe5900048, 0xe2000002,
    0xe3500000, 0x0a000001, 0xe3a00001, 0xe8bd8008, 0xe59f0324, 0xe5900000, 0xe3800102, 0xe59f2318,
    0xe5820000, 0xe59f0310, 0xe5900048, 0xe2000001, 0xe3500000, 0x1a000001, 0xe3a00001, 0xeafffff2,
    0xe59f02f4, 0xe5900030, 0xe3c00901, 0xe1d120b0, 0xe7e02552, 0xe1800702, 0xe59f22dc, 0xe5820030,
    0xe1d100b0, 0xe7e00550, 0xe3500000, 0x0a00000b, 0xe1a00002, 0xe5900024, 0xe3c008ff, 0xe5d12004,
    0xe1800802, 0xe59f22b0, 0xe5820024, 0xe5d10000, 0xe5922030, 0xe7df2f10, 0xe59f029c, 0xe5802030,
    0xe59f0294, 0xe5900030, 0xe3c00a01, 0xe1d120b0, 0xe7e025d2, 0xe1800602, 0xe59f227c, 0xe5820030,
    0xe1d100b0, 0xe7e005d0, 0xe3500000, 0x0a00000e, 0xe1a00002, 0xe5900024, 0xe3c000ff, 0xe5d12005,
    0xe1800002, 0xe59f2250, 0xe5820024, 0xe1a00002, 0xe5900030, 0xe3c00203, 0xe5d12000, 0xe7e12152,
    0xe1800e02, 0xe59f2230, 0xe5820030, 0xe59f0228, 0xe5900030, 0xe3c00c0f, 0xe1d120b0, 0xe7e32652,
    0xe1800402, 0xe59f2210, 0xe5820030, 0xe1d100b0, 0xe7e30650, 0xe3500000, 0x0a000009, 0xe5910008,
    0xe5820028, 0xe1a00002, 0xe5900030, 0xe3c00403, 0xe5d12000, 0xe7e12252, 0xe1800c02, 0xe59f21d8,
    0xe5820030, 0xe59f01d0, 0xe5900030, 0xe3c000f0, 0xe5912000, 0xe7e32852, 0xe1800202, 0xe59f21b8,
    0xe5820030, 0xe5910000, 0xe7e30850, 0xe3500000, 0x0a000011, 0xe5d1000c, 0xe1a00c00, 0xe5d1200d,
    0xe1800802, 0xe5d1200e, 0xe1800402, 0xe5d1200f, 0xe1800002, 0xe59f2180, 0xe582002c, 0xe1a00002,
    0xe5900030, 0xe3c00603, 0xe5d12000, 0xe7e12352, 0xe1800a02, 0xe59f2160, 0xe5820030, 0xe59f0158,
    0xe5900030, 0xe3c0000f, 0xe5912000, 0xe7e32a52, 0xe1800002, 0xe59f2140, 0xe5820030, 0xe5910000,
    0xe7e30a50, 0xe3500000, 0x0a00000b, 0xe5910018, 0xe5820040, 0xe591001c, 0xe5820044, 0xe1a00002,
    0xe5900030, 0xe3c00803, 0xe1d120b0, 0xe7e12452, 0xe1800802, 0xe59f2100, 0xe5820030, 0xe59f00f8,
    0xe5900020, 0xe3c00c01, 0xe5912000, 0xe7e02c52, 0xe1800402, 0xe59f20e0, 0xe5820020, 0xe1d100b0,
    0xe7e10450, 0xe3500000, 0x0a00000d, 0xe5910000, 0xe7e30a50, 0xe3500000, 0x0a000009, 0xe5910000,
    0xe7e00cd0, 0xe3500000, 0x0a000005, 0xe5910000, 0xe7e00d50, 0xe3500000, 0x0a000001, 0xe3a00001,
    0xeaffff59, 0xe59f0090, 0xe5900020, 0xe3c00007, 0xe5912000, 0xe7e02cd2, 0xe1800102, 0xe5912000,
    0xe7e02d52, 0xe1800082, 0xe3800001, 0xe59f2068, 0xe5820020, 0xe1a00002, 0xe5900048, 0xe58d0000,
    0xe1a00002, 0xe5900048, 0xe58d0000, 0xe1a00002, 0xe5900048, 0xe58d0000, 0xe1a00002, 0xe5900048,
    0xe58d0000, 0xe320f000, 0xe59f002c, 0xe5900048, 0xe2000001, 0xe3500000, 0x0afffffa, 0xe59f0018,
    0xe5900038, 0xe5810010, 0xe59f000c, 0xe590003c, 0xe5810014, 0xe3a00000, 0xeaffff33, 0x3fefa000,
    0xfcfe3500, 0xfcfe0438, 0xfcfe7200, 0xfffcfcfc, 0xfff0fefe, 0xe92d4010, 0xebfffe14, 0xe3500001,
    0x1a000001, 0xe3a00002, 0xe8bd8010, 0xe3a00001, 0xeafffffc, 0xe92d4010, 0xe1a04000, 0xe3540001,
    0x1a000002, 0xe3a00000, 0xebfffdd9, 0xea000003, 0xe3540002, 0x1a000001, 0xe3a00001, 0xebfffdd4,
    0xe8bd8010, 0xe92d4010, 0xe3a00001, 0xebfffff0, 0xe3a000eb, 0xebfffe5f, 0xe8bd8010, 0xe92d4070,
    0xe1a05000, 0xe1a04001, 0xe59f0f70, 0xe0800009, 0xe5900000, 0xe3c00003, 0xe59f1f60, 0xe0811009,
    0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00c03, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00b01,
    0xe2800b01, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00b02, 0xe5810000, 0xe2810000, 0xe5900000,
    0xe3c00a0f, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c0080f, 0xe5810000, 0xe2810000, 0xe5900000,
    0xe3c0060f, 0xe2800503, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00401, 0xe5810000, 0xe2810000,
    0xe5900000, 0xe3c00402, 0xe2800402, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00301, 0xe2800301,
    0xe5810000, 0xe3a00005, 0xe5c10004, 0xe3a00000, 0xe5810018, 0xe581001c, 0xe2810000, 0xebfffecd,
    0xe59f0e98, 0xe0800009, 0xe5900010, 0xe1a00c20, 0xe5c50000, 0xe3a00000, 0xe5c40000, 0xe8bd8070,
    0xe92d401c, 0xea000013, 0xe1a0100d, 0xe28d0004, 0xebffffb9, 0xebfffdb5, 0xe3500001, 0x1a000008,
    0xe5dd0004, 0xe2000001, 0xe3500000, 0x1a000009, 0xe5dd0000, 0xe2000001, 0xe3500000, 0x1a000005,
    0xea000005, 0xe5dd0004, 0xe2000001, 0xe3500000, 0x1a000000, 0xea000000, 0xeaffffea, 0xe320f000,
    0xe8bd801c, 0xe92d4010, 0xe59f0e10, 0xe0800009, 0xe5900000, 0xe3c00003, 0xe59f1e00, 0xe0811009,
    0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00b01, 0xe2800b01, 0xe5810000, 0xe2810000, 0xe5900000,
    0xe3c00b02, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00a0f, 0xe5810000, 0xe2810000, 0xe5900000,
    0xe3c0080f, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c0060f, 0xe5810000, 0xe2810000, 0xe5900000,
    0xe3c00401, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00402, 0xe5810000, 0xe2810000, 0xe5900000,
    0xe3c00301, 0xe5810000, 0xe3a00006, 0xe5c10004, 0xe2810000, 0xebfffe7f, 0xe8bd8010, 0xe92d4070,
    0xe1a05000, 0xe1a04001, 0xebffffcd, 0xe59f0d4c, 0xe0800009, 0xe5900000, 0xe3c00003, 0xe59f1d3c,
    0xe0811009, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c000c0, 0xe5810000, 0xe2810000, 0xe5900000,
    0xe3c00b01, 0xe2800b01, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00b02, 0xe5810000, 0xe2810000,
    0xe5900000, 0xe3c00a0f, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c0080f, 0xe2800703, 0xe5810000,
    0xe2810000, 0xe5900000, 0xe3c0060f, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00401, 0xe5810000,
    0xe2810000, 0xe5900000, 0xe3c00402, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00301, 0xe5810000,
    0xe3a00001, 0xe5c10004, 0xe2050043, 0xe5c1000c, 0xe2810000, 0xe5c0400d, 0xebfffe46, 0xebffff7f,
    0xe8bd8070, 0xe92d4070, 0xe1a05000, 0xe1a04001, 0xe59f0c68, 0xe0800009, 0xe5900000, 0xe3c00003,
    0xe59f1c58, 0xe0811009, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00c03, 0xe5810000, 0xe2810000,
    0xe5900000, 0xe3c00b01, 0xe2800b01, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00b02, 0xe5810000,
    0xe2810000, 0xe5900000, 0xe3c00a0f, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c0080f, 0xe5810000,
    0xe2810000, 0xe5900000, 0xe3c0060f, 0xe2800503, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00401,
    0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00402, 0xe2800402, 0xe5810000, 0xe2810000, 0xe5900000,
    0xe3c00301, 0xe2800301, 0xe5810000, 0xe3a00015, 0xe5c10004, 0xe3a00000, 0xe5810018, 0xe581001c,
    0xe2810000, 0xebfffe0b, 0xe59f0b90, 0xe0800009, 0xe5900010, 0xe1a00c20, 0xe5c50000, 0xe3a00000,
    0xe5c40000, 0xe8bd8070, 0xe92d401f, 0xe1a04000, 0xe28d1008, 0xe28d000c, 0xebfffef7, 0xe1a0100d,
    0xe28d0004, 0xebffffb6, 0xe3540002, 0x1a000004, 0xe5dd100c, 0xe3c10040, 0xe5dd1004, 0xebffff76,
    0xea000005, 0xe3540003, 0x1a000003, 0xe5dd100c, 0xe3810040, 0xe5dd1004, 0xebffff6f, 0xe8bd801f,
    0xe92d4010, 0xe3a00000, 0xebfffce4, 0xe3a00003, 0xebffffe4, 0xe8bd8010, 0xe92d401f, 0xe1a04000,
    0xe28d1008, 0xe28d000c, 0xebfffedb, 0xe1a0100d, 0xe28d0004, 0xebffff9a, 0xe3540001, 0x1a000003,
    0xe5dd000c, 0xe3c0003c, 0xe58d000c, 0xea000002, 0xe5dd000c, 0xe380003c, 0xe58d000c, 0xe5dd1004,
    0xe5dd000c, 0xebffff54, 0xe8bd801f, 0xe92d4010, 0xebffff23, 0xe59f0aa4, 0xe0800009, 0xe5900000,
    0xe3c00003, 0xe59f1a94, 0xe0811009, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00b01, 0xe2800b01,
    0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00b02, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00a0f,
    0xe5810000, 0xe2810000, 0xe5900000, 0xe3c0080f, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c0060f,
    0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00401, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00402,
    0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00301, 0xe5810000, 0xe3a000c7, 0xe5c10004, 0xe2810000,
    0xebfffda4, 0xebfffedd, 0xe8bd8010, 0xe92d4070, 0xe1a04000, 0xe1a05804, 0xebfffef1, 0xe59f09dc,
    0xe0800009, 0xe5900000, 0xe3c00003, 0xe59f19cc, 0xe0811009, 0xe5810000, 0xe2810000, 0xe5900000,
    0xe3c00030, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00b01, 0xe2800b01, 0xe5810000, 0xe2810000,
    0xe5900000, 0xe3c00b02, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00a0f, 0xe2800a07, 0xe5810000,
    0xe2810000, 0xe5900000, 0xe3c0080f, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c0060f, 0xe5810000,
    0xe2810000, 0xe5900000, 0xe3c00401, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00402, 0xe5810000,
    0xe2810000, 0xe5900000, 0xe3c00301, 0xe5810000, 0xe3a000d8, 0xe5c10004, 0xe2810000, 0xe5805008,
    0xebfffd6c, 0xebfffea5, 0xe8bd8070, 0xe92d41f0, 0xe1a07000, 0xe1a05001, 0xe1a04002, 0xebfffeb8,
    0xe59f08f8, 0xe0800009, 0xe5900000, 0xe3c00003, 0xe59f18e8, 0xe0811009, 0xe5810000, 0xe2810000,
    0xe5900000, 0xe3c00030, 0xe2800020, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00b01, 0xe2800b01,
    0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00b02, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00a0f,
    0xe2800a07, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c0080f, 0xe5810000, 0xe2810000, 0xe5900000,
    0xe3c0060f, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00401, 0xe2800401, 0xe5810000, 0xe2810000,
    0xe5900000, 0xe3c00402, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00301, 0xe5810000, 0xe3a00038,
    0xe5c10004, 0xebfffc29, 0xe3500001, 0x1a000004, 0xe1a000a7, 0xe59f1824, 0xe0811009, 0xe5810008,
    0xea000002, 0xe59f0814, 0xe0800009, 0xe5807008, 0xe59f0808, 0xe0800009, 0xebfffd26, 0xe59f07fc,
    0xe0800009, 0xe5900000, 0xe3c00c03, 0xe2800c02, 0xe59f17e8, 0xe0811009, 0xe5810000, 0xe2810000,
    0xe5900000, 0xe3c00b01, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00b02, 0xe5810000, 0xe2810000,
    0xe5900000, 0xe3c00a0f, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c0080f, 0xe5810000, 0xe2810000,
    0xe5900000, 0xe3c00402, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00301, 0xe2800301, 0xe5810000,
    0xebfffbfa, 0xe3500001, 0x1a000030, 0xe1a01fc4, 0xe0841ea1, 0xe1a011c1, 0xe0441181, 0xe3510000,
    0x1a000009, 0xe59f0754, 0xe0800009, 0xe5900000, 0xe3c0060f, 0xe280060f, 0xe59f1740, 0xe0811009,
    0xe5810000, 0xe3a06008, 0xea000049, 0xe1a01fc4, 0xe0841f21, 0xe1a01141, 0xe0441101, 0xe3510000,
    0x1a000009, 0xe59f0714, 0xe0800009, 0xe5900000, 0xe3c0060f, 0xe2800503, 0xe59f1700, 0xe0811009,
    0xe5810000, 0xe3a06004, 0xea000039, 0xe1a00004, 0xe0841fa0, 0xe1a010c1, 0xe0441081, 0xe3510000,
    0x1a000009, 0xe59f06d4, 0xe0800009, 0xe5900000, 0xe3c0060f, 0xe2800502, 0xe59f16c0, 0xe0811009,
    0xe5810000, 0xe3a06002, 0xea000029, 0xe8bd81f0, 0xe1a01fc4, 0xe0841f21, 0xe1a01141, 0xe0441101,
    0xe3510000, 0x1a000009, 0xe59f0690, 0xe0800009, 0xe5900000, 0xe3c0060f, 0xe280060f, 0xe59f167c,
    0xe0811009, 0xe5810000, 0xe3a06004, 0xea000018, 0xe1a00004, 0xe0841fa0, 0xe1a010c1, 0xe0441081,
    0xe3510000, 0x1a000009, 0xe59f0650, 0xe0800009, 0xe5900000, 0xe3c0060f, 0xe2800503, 0xe59f163c,
    0xe0811009, 0xe5810000, 0xe3a06002, 0xea000008, 0xe59f0628, 0xe0800009, 0xe5900000, 0xe3c0060f,
    0xe2800502, 0xe59f1614, 0xe0811009, 0xe5810000, 0xe3a06001, 0xea000059, 0xe5d50000, 0xe59f15fc,
    0xe0811009, 0xe5810018, 0xe2855001, 0xe3560002, 0xba000009, 0xe2810000, 0xe5900018, 0xe5d51000,
    0xe3a02cff, 0xe0021401, 0xe1800001, 0xe59f15cc, 0xe0811009, 0xe5810018, 0xe2855001, 0xe3560004,
    0xba000014, 0xe59f05b4, 0xe0800009, 0xe5900018, 0xe5d51000, 0xe3a028ff, 0xe0021801, 0xe1800001,
    0xe59f1598, 0xe0811009, 0xe5810018, 0xe2855001, 0xe2810000, 0xe5900018, 0xe5d51000, 0xe3a024ff,
    0xe0021c01, 0xe1800001, 0xe59f1570, 0xe0811009, 0xe5810018, 0xe2855001, 0xe3560008, 0xba000022,
    0xe5d50000, 0xe59f1554, 0xe0811009, 0xe581001c, 0xe2855001, 0xe2810000, 0xe590001c, 0xe5d51000,
    0xe3a02cff, 0xe0021401, 0xe1800001, 0xe59f152c, 0xe0811009, 0xe581001c, 0xe2855001, 0xe2810000,
    0xe590001c, 0xe5d51000, 0xe3a028ff, 0xe0021801, 0xe1800001, 0xe59f1504, 0xe0811009, 0xe581001c,
    0xe2855001, 0xe2810000, 0xe590001c, 0xe5d51000, 0xe3a024ff, 0xe0021c01, 0xe1800001, 0xe59f14dc,
    0xe0811009, 0xe581001c, 0xe2855001, 0xe0444006, 0xe3540000, 0xca000006, 0xe59f04c0, 0xe0800009,
    0xe5900000, 0xe3c00401, 0xe59f14b0, 0xe0811009, 0xe5810000, 0xe59f04a4, 0xe0800009, 0xebfffc4d,
    0xe3540000, 0xcaffffa3, 0xebfffd84, 0xe320f000, 0xeaffff75, 0xe92d41f0, 0xe1a07000, 0xe1a08001,
    0xe1a05002, 0xe1a04003, 0xebfffd95, 0xe59f046c, 0xe0800009, 0xe5900000, 0xe3c00003, 0xe59f145c,
    0xe0811009, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00030, 0xe2800020, 0xe5810000, 0xe2810000,
    0xe5900000, 0xe3c00b01, 0xe2800b01, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00b02, 0xe5810000,
    0xe2810000, 0xe5900000, 0xe3c00a0f, 0xe2800a07, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c0080f,
    0xe5810000, 0xe2810000, 0xe5900000, 0xe3c0060f, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00401,
    0xe2800401, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00402, 0xe5810000, 0xe2810000, 0xe5900000,
    0xe3c00301, 0xe5810000, 0xe3a00038, 0xe5c10004, 0xebfffb06, 0xe3500001, 0x1a000004, 0xe1a000a7,
    0xe59f1398, 0xe0811009, 0xe5810008, 0xea000002, 0xe59f0388, 0xe0800009, 0xe5807008, 0xe59f037c,
    0xe0800009, 0xebfffc03, 0xe59f0370, 0xe0800009, 0xe5900000, 0xe3c00c03, 0xe2800c02, 0xe59f135c,
    0xe0811009, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00b01, 0xe5810000, 0xe2810000, 0xe5900000,
    0xe3c00b02, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00a0f, 0xe5810000, 0xe2810000, 0xe5900000,
    0xe3c0080f, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00402, 0xe5810000, 0xe2810000, 0xe5900000,
    0xe3c00301, 0xe2800301, 0xe5810000, 0xebfffad7, 0xe3500001, 0x1a000030, 0xe1a01fc4, 0xe0841ea1,
    0xe1a011c1, 0xe0441181, 0xe3510000, 0x1a000009, 0xe59f02c8, 0xe0800009, 0xe5900000, 0xe3c0060f,
    0xe280060f, 0xe59f12b4, 0xe0811009, 0xe5810000, 0xe3a06008, 0xea000049, 0xe1a01fc4, 0xe0841f21,
    0xe1a01141, 0xe0441101, 0xe3510000, 0x1a000009, 0xe59f0288, 0xe0800009, 0xe5900000, 0xe3c0060f,
    0xe2800503, 0xe59f1274, 0xe0811009, 0xe5810000, 0xe3a06004, 0xea000039, 0xe1a00004, 0xe0841fa0,
    0xe1a010c1, 0xe0441081, 0xe3510000, 0x1a000009, 0xe59f0248, 0xe0800009, 0xe5900000, 0xe3c0060f,
    0xe2800502, 0xe59f1234, 0xe0811009, 0xe5810000, 0xe3a06002, 0xea000029, 0xe8bd81f0, 0xe1a01fc4,
    0xe0841f21, 0xe1a01141, 0xe0441101, 0xe3510000, 0x1a000009, 0xe59f0204, 0xe0800009, 0xe5900000,
    0xe3c0060f, 0xe280060f, 0xe59f11f0, 0xe0811009, 0xe5810000, 0xe3a06004, 0xea000018, 0xe1a00004,
    0xe0841fa0, 0xe1a010c1, 0xe0441081, 0xe3510000, 0x1a000009, 0xe59f01c4, 0xe0800009, 0xe5900000,
    0xe3c0060f, 0xe2800503, 0xe59f11b0, 0xe0811009, 0xe5810000, 0xe3a06002, 0xea000008, 0xe59f019c,
    0xe0800009, 0xe5900000, 0xe3c0060f, 0xe2800502, 0xe59f1188, 0xe0811009, 0xe5810000, 0xe3a06001,
    0xea000059, 0xe5d50000, 0xe3a014ff, 0xe0010c00, 0xe59f1168, 0xe0811009, 0xe5810018, 0xe2855001,
    0xe3560002, 0xba000009, 0xe2810000, 0xe5900018, 0xe5d51000, 0xe3a028ff, 0xe0021801, 0xe1800001,
    0xe59f1138, 0xe0811009, 0xe5810018, 0xe2855001, 0xe3560004, 0xba000012, 0xe59f0120, 0xe0800009,
    0xe5900018, 0xe5d51000, 0xe3a02cff, 0xe0021401, 0xe1800001, 0xe59f1104, 0xe0811009, 0xe5810018,
    0xe2855001, 0xe2810000, 0xe5901018, 0xe5d50000, 0xe1800001, 0xe59f10e4, 0xe0811009, 0xe5810018,
    0xe2855001, 0xe3560008, 0xba000022, 0xe5d50000, 0xe3a014ff, 0xe0010c00, 0xe59f10c0, 0xe0811009,
    0xe581001c, 0xe2855001, 0xe2810000, 0xe590001c, 0xe5d51000, 0xe3a028ff, 0xe0021801, 0xe1800001,
    0xe59f1098, 0xe0811009, 0xe581001c, 0xe2855001, 0xe2810000, 0xe590001c, 0xe5d51000, 0xe3a02cff,
    0xe0021401, 0xe1800001, 0xe59f1070, 0xe0811009, 0xe581001c, 0xe2855001, 0xe2810000, 0xe590101c,
    0xe5d50000, 0xe1800001, 0xe59f1050, 0xe0811009, 0xe581001c, 0xe2855001, 0xe0444006, 0xe3540000,
    0xca000006, 0xe59f0034, 0xe0800009, 0xe5900000, 0xe3c00401, 0xe59f1024, 0xe0811009, 0xe5810000,
    0xe59f0018, 0xe0800009, 0xebfffb2a, 0xe3540000, 0xcaffffa3, 0xebfffc61, 0xe320f000, 0xeaffff75,
    0x00000008, 0xe92d4070, 0xe1a06000, 0xe1a04001, 0xe1a05002, 0xe59f0454, 0xe0800009, 0xe5900000,
    0xe3c00003, 0xe59f1444, 0xe0811009, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00030, 0xe5810000,
    0xe2810000, 0xe5900000, 0xe3c00b01, 0xe2800b01, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00b02,
    0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00a0f, 0xe2800a07, 0xe5810000, 0xe2810000, 0xe5900000,
    0xe3c0080f, 0xe2800702, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c0060f, 0xe5810000, 0xe2810000,
    0xe5900000, 0xe3c00401, 0xe2800401, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00402, 0xe5810000,
    0xe2810000, 0xe5900000, 0xe3c00301, 0xe5810000, 0xe3a0006b, 0xe5c10004, 0xebfff9e4, 0xe3500001,
    0x1a000004, 0xe1a000a6, 0xe59f1380, 0xe0811009, 0xe5810008, 0xea000002, 0xe59f0370, 0xe0800009,
    0xe5806008, 0xe59f0364, 0xe0800009, 0xebfffae1, 0xe59f0358, 0xe0800009, 0xe5900000, 0xe3c00c03,
    0xe2800c02, 0xe59f1344, 0xe0811009, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00b01, 0xe5810000,
    0xe2810000, 0xe5900000, 0xe3c00b02, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00a0f, 0xe5810000,
    0xe2810000, 0xe5900000, 0xe3c0080f, 0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00402, 0xe2800402,
    0xe5810000, 0xe2810000, 0xe5900000, 0xe3c00301, 0xe5810000, 0xebfff9b5, 0xe3500001, 0x1a000021,
    0xe3550008, 0x1a000008, 0xe59f02c0, 0xe0800009, 0xe5900000, 0xe3c0060f, 0xe280060f, 0xe59f12ac,
    0xe0811009, 0xe5810000, 0xea000034, 0xe3550004, 0x1a000008, 0xe59f0294, 0xe0800009, 0xe5900000,
    0xe3c0060f, 0xe2800503, 0xe59f1280, 0xe0811009, 0xe5810000, 0xea000029, 0xe3550002, 0x1a000008,
    0xe59f0268, 0xe0800009, 0xe5900000, 0xe3c0060f, 0xe2800502, 0xe59f1254, 0xe0811009, 0xe5810000,
    0xea00001e, 0xe8bd8070, 0xe3550004, 0x1a000008, 0xe59f0238, 0xe0800009, 0xe5900000, 0xe3c0060f,
    0xe280060f, 0xe59f1224, 0xe0811009, 0xe5810000, 0xea000012, 0xe3550002, 0x1a000008, 0xe59f020c,
    0xe0800009, 0xe5900000, 0xe3c0060f, 0xe2800503, 0xe59f11f8, 0xe0811009, 0xe5810000, 0xea000007,
    0xe59f01e8, 0xe0800009, 0xe5900000, 0xe3c0060f, 0xe2800502, 0xe59f11d4, 0xe0811009, 0xe5810000,
    0xe59f01c8, 0xe0800009, 0xe5900000, 0xe3c00401, 0xe59f11b8, 0xe0811009, 0xe5810000, 0xe2810000,
    0xebfffa74, 0xe59f01a4, 0xe0800009, 0xe5900010, 0xe1a00c20, 0xe4c40001, 0xe3550002, 0xba000004,
    0xe59f0188, 0xe0800009, 0xe5900010, 0xe1a00820, 0xe4c40001, 0xe3550004, 0xba000008, 0xe59f016c,
    0xe0800009, 0xe1d001b0, 0xe1a00420, 0xe4c40001, 0xe59f0158, 0xe0800009, 0xe5d00010, 0xe4c40001,
    0xe3550008, 0xba000012, 0xe59f0140, 0xe0800009, 0xe5900014, 0xe1a00c20, 0xe4c40001, 0xe59f012c,
    0xe0800009, 0xe5900014, 0xe1a00820, 0xe4c40001, 0xe59f0118, 0xe0800009, 0xe1d001b4, 0xe1a00420,
    0xe4c40001, 0xe59f0104, 0xe0800009, 0xe5d00014, 0xe4c40001, 0xe320f000, 0xeaffffa9, 0xe92d41f0,
    0xe1a06000, 0xe1a07001, 0xe1a04002, 0xebfff937, 0xe3500001, 0x1a000018, 0xe1a01fc4, 0xe0841ea1,
    0xe1a011c1, 0xe0441181, 0xe3510000, 0x1a000001, 0xe3a05008, 0xea000021, 0xe1a01fc4, 0xe0841f21,
    0xe1a01141, 0xe0441101, 0xe3510000, 0x1a000001, 0xe3a05004, 0xea000019, 0xe1a00004, 0xe0841fa0,
    0xe1a010c1, 0xe0441081, 0xe3510000, 0x1a000001, 0xe3a05002, 0xea000011, 0xe8bd81f0, 0xe1a01fc4,
    0xe0841f21, 0xe1a01141, 0xe0441101, 0xe3510000, 0x1a000001, 0xe3a05004, 0xea000008, 0xe1a00004,
    0xe0841fa0, 0xe1a010c1, 0xe0441081, 0xe3510000, 0x1a000001, 0xe3a05002, 0xea000000, 0xe3a05001,
    0xea000006, 0xe1a02005, 0xe1a01007, 0xe1a00006, 0xebfffeeb, 0xe0866005, 0xe0877005, 0xe0444005,
    0xe3540000, 0xcafffff6, 0xe320f000, 0xeaffffe1, 0x00000008, 0xe92d4070, 0xe59f40ac, 0xe3a05000,
    0xea000002, 0xe3e00000, 0xe4840004, 0xe2855001, 0xe3550010, 0xbafffffa, 0xebfff88f, 0xebfffc0f,
    0xebfff8b0, 0xe3500000, 0x0a000001, 0xe3e00000, 0xe8bd8070, 0xe3a00000, 0xeafffffc, 0xe92d4010,
    0xebfff895, 0xe3500000, 0x0a000001, 0xe3e00000, 0xe8bd8010, 0xe3a00000, 0xeafffffc, 0xe92d4010,
    0xe1a04000, 0xe1a00004, 0xebfffc47, 0xe3a00000, 0xe8bd8010, 0xe92d4010, 0xebfffc13, 0xe3a00000,
    0xe8bd8010, 0xe92d4070, 0xe1a06000, 0xe1a04001, 0xe1a05002, 0xe1a02004, 0xe1a01005, 0xe1a00006,
    0xebfffc71, 0xe3a00000, 0xe8bd8070, 0xe8201180, 0x00000000, 0x00000000,
};

static const TARGET_FLASH flash = {
    0x20020020, // Init
    0x2002005C, // UnInit
    0x20020070, // EraseChip
    0x200200A4, // EraseSector
    0x200200D0, // ProgramPage
    0x0,        // Verify

    // RSB : base address is address of Execution Region PrgData in map file
    //       to access global/static data
    // RSP : Initial stack pointer
    {RAM_START, (RAM_START + sizeof(RZA1H_FLM)), RAM_START + 0x00010000}, // {breakpoint, RSB, RSP}

    RAM_START + 0x00004000, // program_buffer
    RAM_START,            // algo_start
    sizeof(RZA1H_FLM),    // algo_size
    RZA1H_FLM,            // image

    256          // ram_to_flash_bytes_to_be_written
};

#endif
